#include <stdio.h>

#define DEBUG 0

#if DEBUG
#define NAME_LEN 25

#define MAX_PARTS 100

struct part {
int number;
char name[NAME_LEN+1];
int on_hand;
};


int read_line(char str[], int n);
int find_part(int number, const struct part inv[], int np);
void insert(struct part inv[], int *np);
void search(const struct part inv[], int np);
void update(struct part inv[], int np);
void print(const struct part inv[], int np);
#else
#include"lab51.h"
#endif
int main()
{
    char code;
    struct part {
        int number;
        char name[NAME_LEN+1];
        int on_hand;
    }inventory[MAX_PARTS];
    int number_parts = 0;
    while (1)
    {
        printf("Enter operation code:");
        // scanf(" %c", &code);
        // if(code==' '||code=='\n') continue;
        scanf("%c", &code);
        while (getchar() != '\n')
            ;
        switch (code)
        {
            
            case 'i':
                insert(inventory, &number_parts);
                break;
            case 's':
                search(inventory, number_parts);
                break;
            case 'u':
                update(inventory, number_parts);
                break;
            case 'p':
                print(inventory, number_parts);
                break;
            case 'q':
                return 0;
            default:
                printf("Illegal code\n");
        }
        printf("\n");
    }

    return 0;
}

void insert(struct part inv[], int *np)
{
    return;
}
void search(const struct part inv[], int np)
{
    
    return;

}
void update(struct part inv[], int np)
{
    return;
}
void print(const struct part inv[], int np)
{

    return;
}